package org.zjx.service.impl;

import org.zjx.server.annotation.RpcService;
import org.zjx.service.HelloService;

@RpcService(HelloService.class)
public class HelloServiceImpl implements HelloService {
    @Override
    public String sayHello(String name) {
        return "Hello, " + name + "!";
    }

    @Override
    public String sayHelloWithTimeout(String name, long timeoutMillis) {
        try {
            Thread.sleep(timeoutMillis);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }
        return "Hello after " + timeoutMillis + "ms, " + name + "!";
    }
}